#!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:Zhangcl
fa = open('0921_1.txt.txt','r',encoding="utf-8")
a = fa.readlines()
fa.close()
fb = open('0921_2.txt.txt','r',encoding="utf-8")
b = fb.readlines()
fb.close()
n=0
for i in b:
    if i in a:
        print(i.strip())
        n=n+1
print(n)